package cn.wggf.dev.qcgg.dao.impl;

import java.util.Date;

import cn.wggf.dev.qcgg.dao.UserDao;
import cn.wggf.dev.qcgg.pojo.User;
import cn.wggf.dev.qcgg.util.DateUtil;


/**
 * 
 * 用户类 Dao 接口的实现
 * 
 * @author Yubo Jia
 * 
 */
public class UserDaoImpl implements UserDao {
	public User findById(int id) {
		User u = null;

		if (id == 1) {
			u = new User();
			u.setId(id);
			u.setName("张三");
			u.setNickname("zhangsan");
			u.setGender("男");
			u.setBirthday(new Date());
			u.setPhone("11111111111");
			u.setEmail("11111111111@139.com");
			u.setCity("贵阳");
			u.setProvince("贵州省");
			u.setCountry("中国");
			u.setLanguage("中文");
		}

		return u;
	}

	public User findByNameAndBirthday(String name, String birthday) {
		User u = null;

		if ("张三".equals(name) && "2013-01-01".equals(birthday)) {
			u = new User();
			u.setId(1);
			u.setName(name);
			u.setNickname("zhangsan");
			u.setGender("男");
			u.setBirthday(DateUtil.parse("2013-01-01", "yyyy-MM-dd"));
			u.setPhone("11111111111");
			u.setEmail("11111111111@139.com");
			u.setCity("贵阳");
			u.setProvince("贵州省");
			u.setCountry("中国");
			u.setLanguage("中文");
		}
		
		return u;
	}
}